<!-- Copyright (c) 2019-2020 十三 all rights reserved. -->
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:fragment="head-fragment(title,path)">
    <meta charset="UTF-8">
    <title>Magic_Coffee咖啡店-首页</title>
    <link rel="shortcut icon" href="../../faviconcoffee.ico" />
    <link rel="stylesheet" th:href="@{/mall/css/swiper.min.css}">
    <link rel="stylesheet" th:href="@{/mall/css/iconfont.css}">
    <link rel="stylesheet" th:href="@{/mall/font-awesome-4.7.0/css/font-awesome.css}">
    <link rel="stylesheet" th:href="@{/mall/css/common.css}">
    <link rel="stylesheet" th:href="@{/mall/styles/header.css}">
    <link rel="stylesheet" th:href="@{/mall/styles/general-footer.css}">
    <link rel="stylesheet" th:href="@{/mall/styles/layout/header-search.css}">
    <link rel="stylesheet" th:href="@{'/mall/styles/'+${path}+'.css'}">
    <link rel="stylesheet" th:href="@{/admin/plugins/sweetalert/sweetalert.css}"/>
    <meta name="keywords" content="Magic_Coffee咖啡店管理,spring boot 电商项目" />
    <meta name="description" content="Magic_Coffee咖啡店，包括 ，基于 Spring Boot 2.X 及相关技术栈开发。前台商城系统包含首页门户、商品分类、新品上线、首页轮播、商品推荐、商品搜索、商品展示、购物车、订单结算、订单流程、个人订单管理、。后台管理系统包含数据面板、轮播图管理、商品管理、订单管理、分类管理、设置等模块。"/>
</head>
<nav class="header" th:fragment="header-search-fragment">
    <div class="w">
        <a href="index.html" class="logo">Magic Coffee</a>
        <div class="search-con">
            <input class="search-input" id="search-input" th:value="${keyword}" placeholder="请输入商品名称"/>
            <button class="btn search-btn" id="search-btn" th:onclick="search()">搜索</button>
        </div>
    </div>
</nav>
<header id="header" th:fragment="header-fragment">
    <div class="center">
        <ul class="fl">
            <li><a th:href="@{/index}">Magic Coffee</a></li>
            <li><a th:href="@{/register}">注册</a></li>
        </ul>
        <div class="fr">
            <th:block th:unless="${session.MallUser==null}">
                <div class="user">
                    <ul class="selector">
                        <li>
                            <a th:href="@{/user-center}">
                                个人中心
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/order-list}">
                                我的订单
                            </a>
                        </li>
                        <li>
                            <a th:href="@{/logout}">
                                退出登录
                            </a>
                        </li>
                    </ul>
                    <a href="##" class="username">
                        <th:block th:text="${session.MallUser.username}"></th:block>
                        <i class="iconfont icon-down"></i>
                    </a>
                </div>
                <div class="shopcart">
                    <a th:href="@{/cart_list}" style="color: white;"><i class="iconfont icon-cart"></i>
                        购物车(
                        <th:block th:text="${session.MallUser.CartItemCount}"></th:block>
                        )</a>
                </div>
            </th:block>
            <th:block th:if="${session.MallUser==null}">
                <ul class="login">
                    <li><a th:href="@{/login}">登录</a></li>
                    <li><a th:href="@{/register}">注册</a></li>
                </ul>
                <div class="shopcart">
                    <a th:href="@{/cart_list}" style="color: white;"><i class="iconfont icon-cart"></i>
                        购物车(0)</a>
                </div>
            </th:block>
        </div>
    </div>
</header>
</html>
